package com.dxysun.design.interpreter;

import org.apache.commons.lang3.math.NumberUtils;

public class TerminalExpression implements IExpression
{
	@Override
	public String interpreter(Context context)
	{
		String[] strings = context.getExpression().split(" ");
		int i = 0;
		for(String s : strings)
		{
			if (NumberUtils.isDigits(s))
			{
				i ++;
			}
		}
		return i + "个终结符";
	}
}
